import React from 'react'
import styles from './index.module.less'

export default function Question(props: any) {
    const { dataSource } = props
    const { detail } = dataSource?.userBarrier

    return (
        <div className={styles.container}>
            {detail.map((item: any) => (
                <div className={styles.list} key={item.code}>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            单位名称
                        </div>
                        <div className={styles.text} style={{ width: '36%' }}>
                            {item.company_name || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '9%' }}>
                            岗位
                        </div>
                        <div className={styles.text} style={{ width: '14%' }}>
                            {item.profession_name || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '14%' }}>
                            单位性质
                        </div>
                        <div className={styles.text} style={{ width: '13%' }}>
                            {!item.company_type || item.company_type === '0' ? '暂无' : item.company_type}
                        </div>
                    </div>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            单位地址
                        </div>
                        <div className={styles.text} style={{ width: '36%' }}>
                            {item.company_address || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '14%' }}>
                            招聘信息来源
                        </div>
                        <div className={styles.text} style={{ width: '36%' }}>
                            {item.source_type_name || '暂无'}
                        </div>
                    </div>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            联系人姓名
                        </div>
                        <div className={styles.text} style={{ width: '17%' }}>
                            {item.contact_name || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '17%' }}>
                            联系人电话
                        </div>
                        <div className={styles.text} style={{ width: '17%' }}>
                            {item.contact_phone || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '17%' }}>
                            联系人投递邮箱
                        </div>
                        <div className={styles.text} style={{ width: '18%' }}>
                            {item.contact_email || '暂无'}
                        </div>
                    </div>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            工作内容（岗位职责、任职要求、薪资待遇）
                        </div>
                        <div
                            className={[styles.text, styles.text_left].join(' ')}
                            style={{ width: '86%' }}
                            dangerouslySetInnerHTML={{
                                __html: item?.profession_desc ? item?.profession_desc?.replace(/\n/g, '<br/>') : '暂无',
                            }}
                        />
                    </div>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            发布日期
                        </div>
                        <div className={styles.text} style={{ width: '17%' }}>
                            {item.release_time || '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '17%' }}>
                            招聘人数
                        </div>
                        <div className={styles.text} style={{ width: '17%' }}>
                            {item.recruit_num ? `${item.recruit_num}人` : '暂无'}
                        </div>
                        <div className={styles.label} style={{ width: '17%' }}>
                            填表日期
                        </div>
                        <div className={styles.text} style={{ width: '18%' }}>
                            {item.create_time || '暂无'}
                        </div>
                    </div>

                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            最终是否接受该岗位
                        </div>
                        <div className={styles.text} style={{ width: '17%' }}>
                            {item.match_status === '1' ? <span className={styles.accept}>接受</span> : <span className={styles.reject}>拒绝</span>}
                        </div>
                        <div className={styles.label} style={{ width: '17%' }}>
                            {item.match_status === '1' ? '接受理由' : '拒绝理由'}
                        </div>
                        <div
                            className={styles.text}
                            style={{ width: '52%' }}
                            dangerouslySetInnerHTML={{
                                __html: item?.match_reason ? item?.match_reason?.replace(/\n/g, '<br/>') : '暂无',
                            }}
                        />
                    </div>
                    <div className={styles.rows}>
                        <div className={styles.label} style={{ width: '14%' }}>
                            下一步行动
                        </div>
                        <div
                            className={[styles.text, styles.text_left].join(' ')}
                            style={{ width: '86%' }}
                            dangerouslySetInnerHTML={{
                                __html: item?.next_action ? item?.next_action?.replace(/\n/g, '<br/>') : '暂无',
                            }}
                        />
                    </div>
                </div>
            ))}
        </div>
    )
}
